package com.gtmonitor;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class GTBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
        boolean tmp = settings.getBoolean(Preferences.PREF_AUTOSTART, false);
        if (tmp) { 
            Intent startServiceIntent = new Intent(context, GTmonitorService.class);
            context.startService(startServiceIntent);
        }
    }
}
